﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using AudioPlayer.GUI.Theme;
using System.Drawing.Drawing2D;

namespace AudioPlayer.GUI.Renderer {
	internal class ToolRenderer : ToolStripProfessionalRenderer {
		#region Variables

		#endregion
		#region Constructor
		public ToolRenderer() {
			this.RoundedEdges = false;
			ProfessionalColorTable cl = new ProfessionalColorTable();
			//this.ColorTable.UseSystemColors = true;
		}
		#endregion
		#region Override
		protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e) {
			//base.OnRenderToolStripBackground(e);
			LinearGradientBrush brushBg = new LinearGradientBrush(
				e.AffectedBounds, 
				ThemeManager.ActiveColorTable.ToolStripBackground1, 
				ThemeManager.ActiveColorTable.ToolStripBackground2, 
				LinearGradientMode.Vertical);
			e.Graphics.FillRectangle(brushBg, e.AffectedBounds);
		}
		protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e) {
			//base.OnRenderToolStripBorder(e);
			e.Graphics.DrawLine(new Pen(ThemeManager.ActiveColorTable.ToolStripBorder), e.AffectedBounds.Left, e.AffectedBounds.Bottom-1, e.AffectedBounds.Right, e.AffectedBounds.Bottom-1);
		}
		protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e) {
			base.OnRenderSeparator(e);
		}
		protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e) {

			/*if (e.Item.Selected || e.Item.Pressed) {
				LinearGradientBrush brushBg = null;
				Pen pBorder = new Pen(ThemeManager.ActiveColorTable.ToolStripBorder);
				if (e.Item.Selected) {
					//Mouse is over
					brushBg = new LinearGradientBrush(
						e.Graphics.ClipBounds,
						Color.Red,//ThemeManager.ActiveColorTable.ToolStripBackground1,
						Color.Red,//ThemeManager.ActiveColorTable.ToolStripBackground2,
						LinearGradientMode.Vertical);
					e.Graphics.FillRectangle(brushBg,e.Graphics.ClipBounds);
				} else if (e.Item.Pressed) {
					//Item is pressed
				}

			}*/
			//Pen penBorder = new Pen(ThemeManager.ActiveColorTable.ToolStripBorder);
			//e.Graphics.FillRectangle(Brushes.White,e.Graphics.ClipBounds);
			base.OnRenderButtonBackground(e);
		}
		#endregion
	}
}
